


export default class Mockdata {
    constructor(options={}){
        const defaults = {

          labelTypes: 1, 
          vertexTotal: 200,
          edgeTotal: 500
        }

        this.settings = Object.assign({}, options, defaults)

    }


    mock() {
    var data = {
        nodes: [],
        edges: []
      }
    
      for (var i = 0; i < this.settings.vertexTotal; i++) {
    
        var classType = Math.floor(Math.random() * this.settings.labelTypes);
    
          data.nodes.push({
            id: "node-" + i,
            class: "VERTEX" + classType
          })
      }
    
      for (var i=0;i<this.settings.edgeTotal;i++){
    
          var source = Math.floor(Math.random() * this.settings.vertexTotal);
          var target = Math.floor(Math.random() * this.settings.vertexTotal);
    
          data.edges.push({
              source: data.nodes[source].id,
              target: data.nodes[target].id,
          })
      }
    
      return data;
    

    }



}
